package _33define;

import java.util.HashMap;
import java.util.Map;

public class Demo2 {
    public static void main(String[] args) {
        String input="aababcabcdabcde";
        Map<Character,Integer> count=new HashMap<>();

        for (char c : input.toCharArray()) {
            count.put(c,count.getOrDefault(c,0)+1);
        }
        for (Map.Entry<Character, Integer> characterIntegerEntry : count.entrySet()) {
            char letter=characterIntegerEntry.getKey();
            int counts=characterIntegerEntry.getValue();
            System.out.println(letter+"("+counts+")");
        }
    }
}
